package com.kd.juhaowan.ui.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.kd.juhaowan.R;
import com.kd.juhaowan.http.model.GameModel;
import com.kd.juhaowan.ui.holder.BannerPagerViewHolder;
import com.youth.banner.adapter.BannerAdapter;

import java.util.List;

public class BannerPagerAdapter extends BannerAdapter<GameModel, BannerPagerViewHolder> {


    public BannerPagerAdapter(List<GameModel> datas) {
        super(datas);
    }

    @Override
    public BannerPagerViewHolder onCreateHolder(ViewGroup parent, int viewType) {
        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
        View view = inflater.inflate(R.layout.item_home_banner, parent, false);
//        GameInfoImageViewHolder holder = new GameInfoImageViewHolder(view);
//        holder.setOnItemClickListener(getOnItemClickListener());
//        return holder;
//
//        ImageView imageView = new ImageView(parent.getContext());
//        imageView.setLayoutParams(new ViewGroup.LayoutParams(
//                ViewGroup.LayoutParams.MATCH_PARENT,
//                ViewGroup.LayoutParams.MATCH_PARENT));
//        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        return new BannerPagerViewHolder(view,parent.getContext());
    }

    @Override
    public void onBindView(BannerPagerViewHolder holder, GameModel data, int position, int size) {
        holder.loadGoodsImage(data);
    }
}
